package com.llb666.shop.order.domain.client;

import com.llb666.shop.order.api.dto.OrderItemsDto;
import com.llb666.shop.order.domain.client.entity.bo.OrderItemsBo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author llb666
 */
@Component
@FeignClient(contextId = "itemsClient", value = "shop-items")
public interface ItemsClient {

    @PostMapping("items/orderItems")
    OrderItemsBo getOrderItemsBo(@RequestBody OrderItemsDto orderItemsDto);

    // 减库存
    @PostMapping("items/decreaseStock")
    void decreaseItemSpecStock(@RequestParam("itemSpecId") String itemSpecId,
                               @RequestParam("buyCounts") int buyCounts);
}
